package com.example.fallrainboot.controller;

import com.example.fallrainboot.dto.UserDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static java.lang.Thread.sleep;

@RestController
@RequestMapping("/user/user")
@Api(tags = "Swagger测试接口")
@Slf4j
public class UserController {

    @PostMapping(value = "/getUserListPage")
    @ApiOperation(value = "Swagger测试接口")
    public String getUserListPage(@RequestBody UserDTO userDTO) throws Exception {
        System.out.println("123");
        return "Hello Swagger";
    }


    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        //睡眠2秒
        try {
            sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("消耗时间 ---> {}", System.currentTimeMillis() - start);
    }
}
